LearningStoreJob.Execute Method ()

Execute the commands in the job

Parent Type: LearningStoreJob

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public ReadOnlyCollection<object> Execute ()

Return Value

A collection of output data from the job

Exceptions
Exception type Condition
Microsoft.LearningComponents.Storage.LearningStoreItemNotFoundException

The job failed because an item was not found in the store.

Microsoft.LearningComponents.Storage.LearningStoreConstraintViolationException

The job failed because of a constraint violation.

Microsoft.LearningComponents.Storage.LearningStoreSecurityException

The job failed because a security check failed.

System.InvalidOperationException

An AddOrUpdateItem command failed because multiple matching items were found.

Remarks

See the LearningStoreJob documentation for more information about jobs.

This method participates in transactions as follows:

Example

The following code adds a new user to the store specified by "store":

C#
LearningStore store = new LearningStore("Server=Learning;Database=Mls;Integrated Security=true", "Bob");
Dictionary<string,object> propertyValues = new Dictionary<string,object>();
propertyValues["Name"] = "John Doe";
propertyValues["Key"] = "Company\JohnDoe";
LearningStoreJob job = store.CreateJob();
job.AddItem("UserItem", propertyValues);
ReadOnlyCollection<object> results = job.Execute();
After this code is executed, results[0] contains a LearningStoreItemIdentifier for the newly-added item.